import { addCsvData } from "../csv";
export enum CarAction {
    Zoom = 'Zoom', // 缩放事件
    Swipe = 'Swipe', // 滑动事件
}

export enum CarWidget {
    Car3D = 'Car3D', // 3D汽车展示
}

// 汽车展示事件
function eventCar(action: CarAction.Zoom, widget: CarWidget.Car3D, eventKey: `${CarWidget.Car3D}_zoom`, widgetId: CarWidget.Car3D, value: { center: [number, number], scale: number }): void;
function eventCar(action: CarAction.Swipe, widget: CarWidget.Car3D, eventKey: `${CarWidget.Car3D}_swipe`, widgetId: CarWidget.Car3D, value: { center: [number, number], margin: number }): void;

function eventCar(action: CarAction, widget: CarWidget | null, eventKey: any, widgetId: any, value?: any): void {
    const data = { app: "Car", event_key: eventKey, data_json: { action, widget_type: widget, widget_id: widgetId, value } };
    addCsvData(data);
}

export { eventCar }